package com.openbravo.pos.inventory;

import java.util.Properties;

import cn.ekuma.epos.datalogic.I_DataLogicSales;
import com.openbravo.bean.erp.OperationProduct;
import com.openbravo.data.basic.BasicException;
import com.openbravo.data.user.DirtyManager;
import com.openbravo.format.Formats;
import com.openbravo.pos.base.AppLocal;
import com.openbravo.pos.panels.AbstractRefProductEditor;

public class OperationProductEditor extends AbstractRefProductEditor<OperationProduct>{

	public OperationProductEditor(I_DataLogicSales app, DirtyManager dirty) {
		super(app, dirty, true);
	}

   
    public String getTabName() {
        return AppLocal.getIntString("label.operationProduct");
    }

    @Override
    public OperationProduct createNew(Properties prop) {
        return new OperationProduct(parentNode.getParentKey().getKey());
    }

    @Override
    public void rebuild(OperationProduct obj) throws BasicException {
           obj.setUnits((Double)Formats.DOUBLE.parseValue(jUnit.getText()));
    }

    @Override
    public void updateUI(boolean editAble, int state) {
        super.updateUI(editAble, state);
        jUnit.setText(Formats.DOUBLE.formatValue(obj.getUnits()));
    }

    @Override
    public Class getEditClass() {
        return OperationProduct.class;
    }

    public void refresh() {
    }
	
}